import request from '@/utils/request';

//h获取区域列表
export async function GetAreaList(){
    try {
        const res = await request.get('/api/screen/areaList')

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取各区预警
export async function GetAlarmInformation(){
    try {
        const res = await request.get('/api/screen/alarmInformation')

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取车辆超载统计
export async function GetCarOverload(params){
    try {
        const res = await request.get('/api/screen/carOverload',{
            params
        })

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取任务执行情况
export async function GetMissionPerformance(params){
    try {
        const res = await request.get('/api/screen/missionPerformance',{
            params
        })

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}
//获取企业列表
export async function GetStationList(params){
    try {
        const res = await request.get('/api/screen/stationList',{
            params
        })

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}


//获取各区电子运单上传情况
export async function GetWaybillUpload(){
    try {
        const res = await request.get('/api/screen/waybillUpload')

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取月运单称重重量
export async function GetWaybillWeight(params){
    try {
        const res = await request.get('/api/screen/waybillWeight',{
            params
        })

        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取称重视频
export async function GetWeightVideo(params){
    try {
        const res = await request.get('/api/screen/weightVideo',{
            params
        })
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取注册车辆和驾驶员人数
export async function GetRegistrationNum(){
    try {
        const res = await request.get('/api/screen/registrationNumCondition')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}


//获取重点提醒
export async function GetWeightKeyRemind(params){
    try {
        const res = await request.get('/api/screen/weightKeyRemind',{
            params
        })
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}


//获取总览数据
export async function GetWeightAreaNum(){
    try {
        const res = await request.get('/api/screen/weightAreaConditionNum')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取每日运单走势
export async function GetWayBillDataTrend(params){
    try {
        const res = await request.get('/api/screen/getWayBillDataTrend',{
            params
        })
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}


//平台运营情况
export async function GetPlatformNumCondition(){
    try {
        const res = await request.get('/api/screen/platformNumCondition')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取源头企业数量
export async function GetCompanyListByArea(){
    try {
        const res = await request.get('/api/screen/companyListByArea')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取源头企业性质
export async function GetCompanyListByProperty(){
    try {
        const res = await request.get('/api/screen/companyListByProperty')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取源头企业数量
export async function GetCompanyListByRegulator(){
    try {
        const res = await request.get('/api/screen/companyListByRegulator')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//7日内运单排行榜
export async function GetRankingWaybill(){
    try {
        const res = await request.get('/api/screen/rankingWaybill')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}


//获取7日区域称重排行
export async function GetRankingWeightRecord(){
    try {
        const res = await request.get('/api/screen/rankingWeightRecord')
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}


//按区域划分获取源头企业数量（企业性质）
export async function GetAreaCompanyListByProperty(params){
    try {
        const res = await request.get('/api/screen/getAreaCompanyListByProperty',{
            params
        })
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

//获取大屏特殊配置
export async function GetConfigInformation(params){
    try {
        const res = await request.get('/api/screen/getConfigInformation',{
            params 
        })
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}
//获取当日运单，当日称重，周超载比率信息
export async function GetWayBillAndWeightInformationForDay(params){
    try {
        const res = await request.get('/api/screen/getWayBillAndWeightInformationForDay',{
            params 
        })
        
        return res.code==0?Promise.resolve(res.data):Promise.reject(res.message)
    } catch (error) {
        return Promise.reject(error) 
    }  
}

